SET(BV bv)
SET(CONTAINERS containers)
SET(GEOMETRY geometry)
SET(MATH math)
SET(HASHING hashing)

SET(SOURCES
    ${BV}/Bounds.cpp
    ${BV}/Box.cpp
    ${BV}/Frustum.cpp
    ${BV}/Sphere.cpp
    ${CONTAINERS}/HashIndex.cpp
    ${GEOMETRY}/DrawVert.cpp
    ${GEOMETRY}/JointTransform.cpp
    ${GEOMETRY}/Surface.cpp
    ${GEOMETRY}/Surface_Patch.cpp
    ${GEOMETRY}/Surface_Polytope.cpp
    ${GEOMETRY}/Surface_SweptSpline.cpp
    ${GEOMETRY}/TraceModel.cpp
    ${GEOMETRY}/Winding.cpp
    ${GEOMETRY}/Winding2D.cpp
    ${HASHING}/CRC32.cpp
    ${HASHING}/MD4.cpp
    ${HASHING}/MD5.cpp
    ${MATH}/Angles.cpp
    ${MATH}/Complex.cpp
    ${MATH}/Lcp.cpp
    ${MATH}/Math.cpp
    ${MATH}/Matrix.cpp
    ${MATH}/Ode.cpp
    ${MATH}/Plane.cpp
    ${MATH}/Pluecker.cpp
    ${MATH}/Polynomial.cpp
    ${MATH}/Quat.cpp
    ${MATH}/Rotation.cpp
    ${MATH}/Simd.cpp
    ${MATH}/Simd_3DNow.cpp
    ${MATH}/Simd_AltiVec.cpp
    ${MATH}/Simd_Generic.cpp
    ${MATH}/Simd_MMX.cpp
    ${MATH}/Simd_SSE.cpp
    ${MATH}/Simd_SSE2.cpp
    ${MATH}/Simd_SSE3.cpp
    ${MATH}/Vector.cpp
    Base64.cpp
    CmdArgs.cpp
    Lexer.cpp
    Parser.cpp
    Str.cpp
    Token.cpp
    BitMsg.cpp
    Dict.cpp
    Heap.cpp
    LangDict.cpp
    Lib.cpp
    MapFile.cpp
    Timer.cpp
    precompiled.cpp
)

set(INCLUDE_LIST
    ${BV}/Bounds.h
    ${BV}/Box.h
    ${BV}/Frustum.h
    ${BV}/Sphere.h
    ${CONTAINERS}/BinSearch.h
    ${CONTAINERS}/BTree.h
    ${CONTAINERS}/HashIndex.h
    ${CONTAINERS}/HashTable.h
    ${CONTAINERS}/Hierarchy.h
    ${CONTAINERS}/LinkList.h
    ${CONTAINERS}/List.h
    ${CONTAINERS}/PlaneSet.h
    ${CONTAINERS}/Queue.h
    ${CONTAINERS}/Stack.h
    ${CONTAINERS}/StaticList.h
    ${CONTAINERS}/StrList.h
    ${CONTAINERS}/StrPool.h
    ${CONTAINERS}/VectorSet.h
    ${GEOMETRY}/DrawVert.h
    ${GEOMETRY}/JointTransform.h
    ${GEOMETRY}/Surface.h
    ${GEOMETRY}/Surface_Patch.h
    ${GEOMETRY}/Surface_Polytope.h
    ${GEOMETRY}/Surface_SweptSpline.h
    ${GEOMETRY}/TraceModel.h
    ${GEOMETRY}/Winding.h
    ${GEOMETRY}/Winding2D.h
    ${HASHING}/CRC32.h
    ${HASHING}/MD4.h
    ${HASHING}/MD5.h
    ${MATH}/Angles.h
    ${MATH}/Complex.h
    ${MATH}/Curve.h
    ${MATH}/Extrapolate.h
    ${MATH}/Interpolate.h
    ${MATH}/Lcp.h
    ${MATH}/Math.h
    ${MATH}/Matrix.h
    ${MATH}/Ode.h
    ${MATH}/Plane.h
    ${MATH}/Pluecker.h
    ${MATH}/Polynomial.h
    ${MATH}/Quat.h
    ${MATH}/Random.h
    ${MATH}/Rotation.h
    ${MATH}/Simd.h
    ${MATH}/Simd_3DNow.h
    ${MATH}/Simd_AltiVec.h
    ${MATH}/Simd_Generic.h
    ${MATH}/Simd_MMX.h
    ${MATH}/Simd_SSE.h
    ${MATH}/Simd_SSE2.h
    ${MATH}/Simd_SSE3.h
    ${MATH}/Vector.h
    Base64.h
    CmdArgs.h
    Lexer.h
    Parser.h
    Str.h
    Token.h
    BitMsg.h
    Dict.h
    Heap.h
    LangDict.h
    Lib.h
    MapFile.h
    precompiled.h
    Timer.h
)

ADD_DEFINITIONS(
    -D__IDLIB__
    -fPIC
)

ADD_LIBRARY(idlib STATIC ${SOURCES})

IF (APPLE)
    TARGET_LINK_LIBRARIES(idlib -m32)
    ADD_DEFINITIONS(-m32)
ENDIF (APPLE)
